<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2025/5/11
  Time: 16:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
  <head>
    <title>校园二手交易平台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link type="text/css" rel="stylesheet" href="css/base.css">
    <link type="text/css" rel="stylesheet" href="css/common.css">
    <link type="text/css" rel="stylesheet" href="css/index.css">
    <script type="text/javascript" src="js/index.js" defer></script>
  </head>
  <body>

<%--  header --%>
<jsp:include page="header.jsp">
  <jsp:param name="flag" value="1"/>
</jsp:include>


<%--轮播图区域--%>
<div class="carousel">
  <div class="carouselImgBox">
    <img src="./picture/carousel1.jpg" class="carouselImg">
    <img src="./picture/carousel2.jpg" class="carouselImg">
    <img src="./picture/carousel3.jpg" class="carouselImg">
  </div>
<%--  控制滑动图片的按键--%>
  <div class="controls">
    <button class="last">〈 </button>
    <button class="next"> 〉</button>
  </div>
</div>


<%--展示商品分类区域--%>
<div class="category-bar container">
  <ul class="category-list">
    <li><a href="/goods_list?categoryId=5" class="category-item" target="_blank">
      <span class="icon">📚</span>
      书籍
    </a></li>
    <li><a href="/goods_list?categoryId=3" class="category-item" target="_blank">
      <span class="icon">💻</span>
      电子产品
    </a></li>
    <li><a href="/goods_list?categoryId=1" class="category-item" target="_blank">
      <span class="icon">🍬</span>
      食品饮料
    </a></li>
    <li><a href="/goods_list?categoryId=4" class="category-item" target="_blank">
      <span class="icon">🏀</span>
      运动器材
    </a></li>
    <li><a href="/goods_list?categoryId=13" class="category-item" target="_blank">
      <span class="icon">📷</span>
      数码配件
    </a></li>
    <li><a href="/goods_list?categoryId=12" class="category-item" target="_blank">
      <span class="icon">🎸</span>
      乐器
    </a></li>
    <li><a href="/goods_list?categoryId=2" class="category-item" target="_blank">
      <span class="icon">👚</span>
      服装
    </a></li>
    <li><a href="/goods_list?categoryId=16" class="category-item" target="_blank">
      <span class="icon">🧹</span>
      生活用品
    </a></li>
    <li><a href="/goods_list?categoryId=17" class="category-item" target="_blank">
      <span class="icon">🧴</span>
      洗漱用品
    </a></li>
    <li><a href="/goods_list?categoryId=6" class="category-item" target="_blank">
      <span class="icon">💄</span>
      化妆品
    </a></li>
    <li><a href="/goods_list?categoryId=9" class="category-item" target="_blank">
      <span class="icon">🖊️</span>
      办公用品
    </a></li>
    <li><a href="/goods_list?categoryId=0" class="category-item more" target="_blank">
      <span class="icon">...</span>
      更多
    </a></li>
  </ul>
</div>


<div class="goods-card-list container index-goods-card-list">
  <c:forEach items="${goodsList}" var="g">
    <a href="/goods_detail?productId=${g.id}" class="index-goods-card-a">
      <div class="goods-card index-goods-card">
        <div class="card-img">
          <img alt="商品图片" src="${g.image1}">
        </div>
        <div class="card-information">
          <h3 class="goods-title">${g.name}</h3>
          <span class="goods-price">￥${g.price}</span>
          <span class="goods-is-bargain">
            <c:choose>
              <c:when test="${g.is_bargain=='true'}">支持砍价</c:when>
              <c:otherwise>不支持砍价</c:otherwise>
            </c:choose>
          </span>
        </div>
      </div>
    </a>
  </c:forEach>
</div>


<%--footer模块--%>
<jsp:include page="footer.jsp"></jsp:include>


  </body>
</html>
